package testDate;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * 测试日期类
 */
public class testCalendar {
    public static void main(String[] args){
        Calendar c = new GregorianCalendar();
        c.set(2018,10,20);
        c.set(Calendar.YEAR,2019);
        Date d = c.getTime();
        System.out.println(d);

        //日期计算
        c.add(Calendar.DATE,30);
        System.out.println(c.getTime());
    }
}
